CREATEPROCEDURE[dbo].[BAERosterManagementCompanyContact] @UserIDasvarchar(10) AS /* General Notes:
Ideally, you would want this procedure to only return one row in order to maximize efficiency. Regardless of how it determines who has access, it absolutely must return the ID field from the iMIS Name table in some fashion.
The member type has to be 'CM' in order for the user to have permission to edit the roster. This can be changed however, in order to better suit a specific site. For example, if you wanted to add any user with the member type "HOTEL" to have permission to edit the roster, you would have to add after the MEMBER_TYPE check:
OR MEMBER_TYPE IN('HOTEL')
Furthermore, suppose you have a user that has a certain membership status, but you do not want them to have access to roster management. You can find their user-id, and put at the end of this statement:
AND ID <> '400'
You must also pass in the User ID of the logged in user, regardless of whether or not it is actually used in the procedure. */ --SELECT ID FROM Name WHERE MEMBER_TYPE IN('CM') AND CO_ID <> '' AND ID = @UserID; SELECTIDFROMNameWHEREMEMBER_TYPEIN('ROST')ANDCO_ID<>''ANDID=@UserID;